package com.syl.starter.itools.common.utils;

import java.util.List;

/**
 * @author syl
 * @create 2020-03-28 15:59
 **/
public class RandomUtils extends org.apache.commons.lang3.RandomUtils{

    /**
     * 从一个list数组中随机一个int
     * @param list
     * @return
     */
    public static Integer nextIntByList(List<Integer> list){
        if (ListUtils.isEmpty(list)) return null;
        int size = list.size();
        return list.get(nextInt(0, size));
    }

}
